Class
HashSet<T>
class HashSet<T>
Module: System.Collections
Assembly: System.Runtime.dll
Source file: HashSet.rvn
Inheritance: Object → HashSet<T>
Implements: MutableSet<T>
An unsynchronized hash set with an explicit equality policy and snapshot iteration.
Constructors
2 items
HashSet(comparer: EqualityComparer<T>)
Creates an empty set. Reentrant comparer callbacks fault.
HashSet(items: Iterable<T>, comparer: EqualityComparer<T>)
Copies distinct elements using an explicit equality policy.
Properties
1 item
Count: int
Gets the number of distinct elements.
Implements Collection<T>.Count
Methods
32 items
Add(value: T) -> bool
Adds an element without replacing an equivalent stored element.
Implements MutableSet<T>.Add
Extension member:
All(predicate: (T) -> bool) -> bool
No summary available.
Extension from Operators.All
Extension member:
Any(predicate: (T) -> bool) -> bool
No summary available.
Extension from Operators.Any
Extension member:
Any() -> bool
Tests whether the source contains an element, or an element satisfying the supplied predicate.
Extension from Operators.Any
Clear() -> ()
Removes all elements.
Implements MutableSet<T>.Clear
Extension member:
Concat(second: Iterable<T>) -> Iterable<T>
Enumerates the first source followed by the second source.
Extension from Operators.Concat
Contains(value: T) -> bool
Tests membership.
Implements Set<T>.Contains
Extension member:
Count(predicate: (T) -> bool) -> int
No summary available.
Extension from Operators.Count
Extension member:
Count() -> int
Counts source elements, optionally restricted by the supplied predicate.
Extension from Operators.Count
Equals(other: object?) -> bool
Tests reference identity by default; an ordinary class may override equality.
Inherited from Object.Equals
Extension member:
Filter(predicate: (T) -> bool) -> Iterable<T>
No summary available.
Extension from Operators.Filter
Find(value: T) -> Optional<T>
Returns the stored equivalent value using this set's comparer.
Implements MutableSet<T>.Find
Extension member:
First(predicate: (T) -> bool) -> Optional<T>
No summary available.
Extension from Operators.First
Extension member:
First() -> Optional<T>
Returns the first source element matching the optional predicate, or None when none exists.
Extension from Operators.First
Extension member:
FlatMap<U>(selector: (T) -> Iterable<U>) -> Iterable<U>
No summary available.
Extension from Operators.FlatMap
Extension member:
Fold<U>(seed: U, accumulator: (U, T) -> U) -> U
No summary available.
Extension from Operators.Fold
GetHashCode() -> int
Returns a stable identity hash by default; an ordinary class may override it consistently with equality.
Inherited from Object.GetHashCode
GetIterator() -> Iterator<T>
Captures a shallow snapshot; the iteration order is unspecified.
Implements Iterable<T>.GetIterator
Extension member:
GetOrInsert(value: T) -> T
Returns the stored equivalent value, inserting the supplied value when absent.
Extension from MutableSetExtensions.GetOrInsert
GetType() -> TypeInfo
Returns metadata for the concrete runtime type of this instance.
Inherited from Object.GetType
Extension member:
Last(predicate: (T) -> bool) -> Optional<T>
No summary available.
Extension from Operators.Last
Extension member:
Last() -> Optional<T>
Returns the last source element matching the optional predicate, or None when none exists.
Extension from Operators.Last
Extension member:
Map<U>(selector: (T) -> U) -> Iterable<U>
No summary available.
Extension from Operators.Map
Extension member:
OfType<U>() -> Iterable<U>
Lazily retains non-null elements compatible with the requested result type, preserving order.
Extension from Operators.OfType
Remove(value: T) -> bool
Removes an equivalent element.
Implements MutableSet<T>.Remove
Extension member:
Single(predicate: (T) -> bool) -> Result<T, SingleError>
No summary available.
Extension from Operators.Single
Extension member:
Single() -> Result<T, SingleError>
Returns the sole matching element, or SingleError.Empty or SingleError.Multiple for a cardinality mismatch.
Extension from Operators.Single
Extension member:
Skip(count: int) -> Iterable<T>
Returns an iterable that skips the requested number of leading elements.
Extension from Operators.Skip
Extension member:
Take(count: int) -> Iterable<T>
Returns an iterable containing at most the requested number of leading elements.
Extension from Operators.Take
Extension member:
ToList() -> ArrayList<T>
Materializes the source into a new ArrayList in enumeration order.
Extension from Operators.ToList
Extension member:
ToMap<K, V>(keySelector: (T) -> K, valueSelector: (T) -> V, comparer: EqualityComparer<K>) -> HashMap<K, V>
Materializes selected keys and values into a new map.
Extension from Operators.ToMap
ToString() -> string
Returns the concrete runtime type name for supported references, or display text from a class or boxed-struct override.
Inherited from Object.ToString